<% vote = nil %>
<% value = nil %>
<% if @user and @votes.include? story.id%>
  <% value = @votes[story.id]%>
<% end %>
<div class="story">
<table>
<tr>
	<% if value == 1 %>
	<td class="voted-up"><%=link_to "yea", :action => "remove_vote", :id => story.id, :go_back => request.request_uri%></td>
	<% else %>
	<td class="vote-up"><%=link_to "yea", :action => "yea", :id => story.id, :go_back => request.request_uri%></td>
	<% end %>
	<td class="headline"><%=link_to story.title, :controller => "story", :action => "goto", :id => story.id%> <%=if story.url =~ /(:\/\/)([^\/]*)/ then "["+$2+"]" end%></td>
</tr>
<tr>
	<% if value == -1 %>
  <td class="voted-down"><%=link_to "nay", :action => "remove_vote", :id => story.id, :go_back => request.request_uri%></td>
  <% else %>
  <td class="vote-down"><%=link_to "nay", :action => "nay", :id => story.id, :go_back => request.request_uri%></td>
  <% end %>
  <td class="meta"><%=pluralize story.points, "point"%>. Posted <%=time_ago_in_words story.created_on %> ago by <%=story.user.name%>.  <%=link_to pluralize(story.comments.size, "comment"), :controller => "comment", :action => "list", :id => story.id%>.</td>	
</tr>

</table>
</div>